#include "motorcycle.h"
#include <iostream>
#include <iomanip>
#include <string>

using namespace std;

Motorcycle::Motorcycle(string pmake, string pmodel, string pstyle, int pstocknum, float pprice)
{
	make = pmake;
	model = pmodel;
	style = pstyle;

	while(pstocknum < 0)
	{
		cout << "Stock number cannot be below 0, please enter another number: ";
		cin >> pstocknum;
	}

	stocknum = pstocknum;
	
	while(pprice < 0)
	{
		cout << "Price cannot be below $0, please enter another price: ";
		cin >> pprice;
	}

	price = pprice;
	
}
//-------------------- These functions are never used -----------------
void Motorcycle::setMake(string pmake)
{
	make = pmake;
}

void Motorcycle::setModel(string pmodel)
{
	model = pmodel;
}

void Motorcycle::setStockNum(int pstocknum)
{
	stocknum = pstocknum;
}

void Motorcycle::setStyle(string pstyle)
{
	style = pstyle;
}

//---------------------------------------------------------------------

void Motorcycle::setPrice(float pprice)
{
	price = pprice;
}


string Motorcycle::getMake()
{
	return make;
}

string Motorcycle::getModel()
{
	return model;
}

float Motorcycle::getPrice()
{
	return price;
}

int Motorcycle::getStockNum()
{
	return stocknum;
}

string Motorcycle::getStyle()
{
	return style;
}


void Motorcycle::print()
{
	cout << fixed << showpoint << setprecision(2);
	cout << left << setw(15) << make << setw(20) << model << setw(14) << stocknum << setw(14) << style << "$" << price << endl;
}
